package traffic

// Code generated by go-bare/cmd/gen, DO NOT EDIT.

import (
	"errors"
	"git.sr.ht/~sircmpwn/go-bare"
)

type Translation struct {
	Language string `bare:"language"`
	Value    string `bare:"value"`
}

func (t *Translation) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Translation) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Trip struct {
	Id                  string        `bare:"id"`
	Headsign            string        `bare:"headsign"`
	TranslatedHeadsigns []Translation `bare:"translatedHeadsigns"`
	Direction           Direction     `bare:"direction"`
	LineID              string        `bare:"lineID"`
	ScheduleID          string        `bare:"scheduleID"`
	ShapeID             string        `bare:"shapeID"`
	Departures          []Departure   `bare:"departures"`
	Headways            []Headway     `bare:"headways"`
}

func (t *Trip) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Trip) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Headway struct {
	Interval  uint `bare:"interval"`
	StartTime uint `bare:"startTime"`
	EndTime   uint `bare:"endTime"`
	Exact     bool `bare:"exact"`
}

func (t *Headway) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Headway) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Vehicle struct {
	Id           string `bare:"id"`
	Capabilities uint16 `bare:"capabilities"`
}

func (t *Vehicle) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Vehicle) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Departure struct {
	StopSequence int                 `bare:"stopSequence"`
	Time         uint                `bare:"time"`
	Pickup       Boarding            `bare:"pickup"`
	Dropoff      Boarding            `bare:"dropoff"`
	StopOffset   uint                `bare:"stopOffset"`
	Exact        bool                `bare:"exact"`
	Ordinality   DepartureOrdinality `bare:"ordinality"`
}

func (t *Departure) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Departure) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Stop struct {
	Id                  string               `bare:"id"`
	Code                string               `bare:"code"`
	Name                string               `bare:"name"`
	TranslatedNames     []Translation        `bare:"translatedNames"`
	NodeName            string               `bare:"nodeName"`
	TranslatedNodeNames []Translation        `bare:"translatedNodeNames"`
	ChangeOptions       []ChangeOption       `bare:"changeOptions"`
	Zone                string               `bare:"zone"`
	Position            Position             `bare:"position"`
	Order               map[string]StopOrder `bare:"order"`
	Timezone            string               `bare:"timezone"`
}

func (t *Stop) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Stop) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type ChangeOption struct {
	LineName            string        `bare:"lineName"`
	LineId              string        `bare:"lineId"`
	Headsign            string        `bare:"headsign"`
	TranslatedHeadsigns []Translation `bare:"translatedHeadsigns"`
}

func (t *ChangeOption) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *ChangeOption) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Position struct {
	Lat float64 `bare:"lat"`
	Lon float64 `bare:"lon"`
}

func (t *Position) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Position) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type LineGraph struct {
	StopCodes []string      `bare:"stopCodes"`
	NextNodes map[int][]int `bare:"nextNodes"`
}

func (t *LineGraph) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *LineGraph) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type StopOrder struct {
	TripOffset uint `bare:"tripOffset"`
	Sequence   int  `bare:"sequence"`
}

func (t *StopOrder) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *StopOrder) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Colour struct {
	R uint8 `bare:"r"`
	G uint8 `bare:"g"`
	B uint8 `bare:"b"`
	A uint8 `bare:"a"`
}

func (t *Colour) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Colour) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Line struct {
	Id                  string            `bare:"id"`
	Name                string            `bare:"name"`
	Colour              Colour            `bare:"colour"`
	Kind                LineType          `bare:"kind"`
	AgencyID            string            `bare:"agencyID"`
	Headsigns           [][]string        `bare:"headsigns"`
	TranslatedHeadsigns [][][]Translation `bare:"translatedHeadsigns"`
	Graphs              []LineGraph       `bare:"graphs"`
}

func (t *Line) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Line) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type FeedInfo struct {
	Name          string                      `bare:"name"`
	Website       string                      `bare:"website"`
	Language      string                      `bare:"language"`
	ValidSince    string                      `bare:"validSince"`
	ValidTill     string                      `bare:"validTill"`
	QrHost        string                      `bare:"qrHost"`
	QrLocation    QRLocation                  `bare:"qrLocation"`
	QrSelector    string                      `bare:"qrSelector"`
	Attributions  map[string]string           `bare:"attributions"`
	Descriptions  map[string]string           `bare:"descriptions"`
	RealtimeFeeds map[RealtimeFeedType]string `bare:"realtimeFeeds"`
	Timezone      string                      `bare:"timezone"`
}

func (t *FeedInfo) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *FeedInfo) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Agency struct {
	Id                     string        `bare:"id"`
	Name                   string        `bare:"name"`
	TranslatedNames        []Translation `bare:"translatedNames"`
	Website                string        `bare:"website"`
	TranslatedWebsites     []Translation `bare:"translatedWebsites"`
	Timezone               string        `bare:"timezone"`
	PhoneNumber            string        `bare:"phoneNumber"`
	TranslatedPhoneNumbers []Translation `bare:"translatedPhoneNumbers"`
	Language               string        `bare:"language"`
	Email                  string        `bare:"email"`
	TranslatedEmails       []Translation `bare:"translatedEmails"`
	FareWebsite            string        `bare:"fareWebsite"`
	TranslatedFareWebsites []Translation `bare:"translatedFareWebsites"`
}

func (t *Agency) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Agency) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type NameOffset struct {
	Name    string `bare:"name"`
	Offsets []uint `bare:"offsets"`
}

func (t *NameOffset) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *NameOffset) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type CodeIndex map[string]uint

func (t *CodeIndex) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *CodeIndex) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Schedule struct {
	Id         string      `bare:"id"`
	DateRanges []DateRange `bare:"dateRanges"`
}

func (t *Schedule) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Schedule) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type DateRange struct {
	Start    string `bare:"start"`
	End      string `bare:"end"`
	Weekdays uint8  `bare:"weekdays"`
}

func (t *DateRange) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *DateRange) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type TimeRange struct {
	StartDate string `bare:"startDate"`
	EndDate   string `bare:"endDate"`
}

func (t *TimeRange) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *TimeRange) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type AlertLua struct {
	TimeRanges   []TimeRange       `bare:"timeRanges"`
	Headers      map[string]string `bare:"headers"`
	Descriptions map[string]string `bare:"descriptions"`
	Urls         map[string]string `bare:"urls"`
	Cause        int               `bare:"cause"`
	Effect       int               `bare:"effect"`
}

func (t *AlertLua) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *AlertLua) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type LuaUpdates struct {
	AreTripsInTimetable bool                  `bare:"areTripsInTimetable"`
	Updates             map[string]Update     `bare:"updates"`
	Alerts              map[string][]AlertLua `bare:"alerts"`
}

func (t *LuaUpdates) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *LuaUpdates) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type LuaError struct {
	HttpResponseCode    int    `bare:"httpResponseCode"`
	Message             string `bare:"message"`
	WillNextRequestFail bool   `bare:"willNextRequestFail"`
}

func (t *LuaError) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *LuaError) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Update struct {
	Time                  string                `bare:"time"`
	TimeUTC               string                `bare:"timeUTC"`
	StopSequence          uint32                `bare:"stopSequence"`
	StopID                string                `bare:"stopID"`
	Delay                 int32                 `bare:"delay"`
	TimetableRelationship TimetableRelationship `bare:"timetableRelationship"`
	VehicleStatus         VehicleStatus         `bare:"vehicleStatus"`
	StartTime             *uint                 `bare:"startTime"`
}

func (t *Update) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *Update) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type VehicleStatus struct {
	Status                  DepartureStatus         `bare:"status"`
	CongestionLevel         CongestionLevel         `bare:"congestionLevel"`
	OccupancyStatus         OccupancyStatus         `bare:"occupancyStatus"`
	VehicleID               string                  `bare:"vehicleID"`
	Latitude                float64                 `bare:"latitude"`
	Longitude               float64                 `bare:"longitude"`
	Speed                   float32                 `bare:"speed"`
	Bearing                 float64                 `bare:"bearing"`
	LineID                  string                  `bare:"lineID"`
	LineName                string                  `bare:"lineName"`
	Headsign                string                  `bare:"headsign"`
	TripID                  string                  `bare:"tripID"`
	WheelchairAccessibility WheelchairAccessibility `bare:"wheelchairAccessibility"`
}

func (t *VehicleStatus) Decode(data []byte) error {
	return bare.Unmarshal(data, t)
}

func (t *VehicleStatus) Encode() ([]byte, error) {
	return bare.Marshal(t)
}

type Direction uint

const (
	THERE Direction = 0
	BACK  Direction = 1
)

func (t Direction) String() string {
	switch t {
	case THERE:
		return "THERE"
	case BACK:
		return "BACK"
	}
	panic(errors.New("Invalid Direction value"))
}

type VehicleCapabilities uint

const (
	RAMP                VehicleCapabilities = 1
	LOW_FLOOR           VehicleCapabilities = 2
	AIR_CONDITIONING    VehicleCapabilities = 4
	BICYCLE             VehicleCapabilities = 8
	VOICE_ANNOUNCEMENTS VehicleCapabilities = 16
	TICKET_MACHINE      VehicleCapabilities = 32
	TICKET_SOLD_DRIVER  VehicleCapabilities = 64
	USB_CHARGING        VehicleCapabilities = 128
	LOW_FLOOR_PARTIAL   VehicleCapabilities = 256
)

func (t VehicleCapabilities) String() string {
	switch t {
	case RAMP:
		return "RAMP"
	case LOW_FLOOR:
		return "LOW_FLOOR"
	case AIR_CONDITIONING:
		return "AIR_CONDITIONING"
	case BICYCLE:
		return "BICYCLE"
	case VOICE_ANNOUNCEMENTS:
		return "VOICE_ANNOUNCEMENTS"
	case TICKET_MACHINE:
		return "TICKET_MACHINE"
	case TICKET_SOLD_DRIVER:
		return "TICKET_SOLD_DRIVER"
	case USB_CHARGING:
		return "USB_CHARGING"
	case LOW_FLOOR_PARTIAL:
		return "LOW_FLOOR_PARTIAL"
	}
	panic(errors.New("Invalid VehicleCapabilities value"))
}

type Boarding uint

const (
	REGULAR   Boarding = 0
	NONE      Boarding = 1
	BY_PHONE  Boarding = 2
	BY_DRIVER Boarding = 3
)

func (t Boarding) String() string {
	switch t {
	case REGULAR:
		return "REGULAR"
	case NONE:
		return "NONE"
	case BY_PHONE:
		return "BY_PHONE"
	case BY_DRIVER:
		return "BY_DRIVER"
	}
	panic(errors.New("Invalid Boarding value"))
}

type DepartureOrdinality uint

const (
	MIDPOINT DepartureOrdinality = 0
	ORIGIN   DepartureOrdinality = 1
	TERMINUS DepartureOrdinality = 2
)

func (t DepartureOrdinality) String() string {
	switch t {
	case MIDPOINT:
		return "MIDPOINT"
	case ORIGIN:
		return "ORIGIN"
	case TERMINUS:
		return "TERMINUS"
	}
	panic(errors.New("Invalid DepartureOrdinality value"))
}

type LineType uint

const (
	TRAM       LineType = 0
	METRO      LineType = 1
	RAIL       LineType = 2
	BUS        LineType = 3
	FERRY      LineType = 4
	CABLE_TRAM LineType = 5
	CABLE_CAR  LineType = 6
	FUNICULAR  LineType = 7
	TROLLEYBUS LineType = 11
	MONORAIL   LineType = 12
)

func (t LineType) String() string {
	switch t {
	case TRAM:
		return "TRAM"
	case METRO:
		return "METRO"
	case RAIL:
		return "RAIL"
	case BUS:
		return "BUS"
	case FERRY:
		return "FERRY"
	case CABLE_TRAM:
		return "CABLE_TRAM"
	case CABLE_CAR:
		return "CABLE_CAR"
	case FUNICULAR:
		return "FUNICULAR"
	case TROLLEYBUS:
		return "TROLLEYBUS"
	case MONORAIL:
		return "MONORAIL"
	}
	panic(errors.New("Invalid LineType value"))
}

type RealtimeFeedType uint

const (
	TRIP_UPDATES      RealtimeFeedType = 0
	VEHICLE_POSITIONS RealtimeFeedType = 1
	ALERTS            RealtimeFeedType = 2
)

func (t RealtimeFeedType) String() string {
	switch t {
	case TRIP_UPDATES:
		return "TRIP_UPDATES"
	case VEHICLE_POSITIONS:
		return "VEHICLE_POSITIONS"
	case ALERTS:
		return "ALERTS"
	}
	panic(errors.New("Invalid RealtimeFeedType value"))
}

type QRLocation uint

const (
	QRLocationUnknown QRLocation = 0
	QRLocationNone    QRLocation = 1
	QRLocationPath    QRLocation = 2
	QRLocationQuery   QRLocation = 3
)

func (t QRLocation) String() string {
	switch t {
	case QRLocationUnknown:
		return "QRLocationUnknown"
	case QRLocationNone:
		return "QRLocationNone"
	case QRLocationPath:
		return "QRLocationPath"
	case QRLocationQuery:
		return "QRLocationQuery"
	}
	panic(errors.New("Invalid QRLocation value"))
}

type TimetableRelationship uint

const (
	NOT_REALTIME   TimetableRelationship = 0
	TRIP_SCHEDULED TimetableRelationship = 1
	TRIP_CANCELED  TimetableRelationship = 2
	TRIP_DELETED   TimetableRelationship = 3
	TRIP_ADDED     TimetableRelationship = 4
	STOP_SKIPPED   TimetableRelationship = 5
	NO_TRIP_DATA   TimetableRelationship = 6
)

func (t TimetableRelationship) String() string {
	switch t {
	case NOT_REALTIME:
		return "NOT_REALTIME"
	case TRIP_SCHEDULED:
		return "TRIP_SCHEDULED"
	case TRIP_CANCELED:
		return "TRIP_CANCELED"
	case TRIP_DELETED:
		return "TRIP_DELETED"
	case TRIP_ADDED:
		return "TRIP_ADDED"
	case STOP_SKIPPED:
		return "STOP_SKIPPED"
	case NO_TRIP_DATA:
		return "NO_TRIP_DATA"
	}
	panic(errors.New("Invalid TimetableRelationship value"))
}

type CongestionLevel uint

const (
	CONGESTION_UNKNOWN     CongestionLevel = 0
	CONGESTION_SMOOTH      CongestionLevel = 1
	CONGESTION_STOP_AND_GO CongestionLevel = 2
	CONGESTION_SIGNIFICANT CongestionLevel = 3
	CONGESTION_SEVERE      CongestionLevel = 4
)

func (t CongestionLevel) String() string {
	switch t {
	case CONGESTION_UNKNOWN:
		return "CONGESTION_UNKNOWN"
	case CONGESTION_SMOOTH:
		return "CONGESTION_SMOOTH"
	case CONGESTION_STOP_AND_GO:
		return "CONGESTION_STOP_AND_GO"
	case CONGESTION_SIGNIFICANT:
		return "CONGESTION_SIGNIFICANT"
	case CONGESTION_SEVERE:
		return "CONGESTION_SEVERE"
	}
	panic(errors.New("Invalid CongestionLevel value"))
}

type OccupancyStatus uint

const (
	OCCUPANCY_UNKNOWN        OccupancyStatus = 0
	OCCUPANCY_EMPTY          OccupancyStatus = 1
	OCCUPANCY_MANY_AVAILABLE OccupancyStatus = 2
	OCCUPANCY_FEW_AVAILABLE  OccupancyStatus = 3
	OCCUPANCY_STANDING_ONLY  OccupancyStatus = 4
	OCCUPANCY_CRUSHED        OccupancyStatus = 5
	OCCUPANCY_FULL           OccupancyStatus = 6
	OCCUPANCY_NOT_ACCEPTING  OccupancyStatus = 7
)

func (t OccupancyStatus) String() string {
	switch t {
	case OCCUPANCY_UNKNOWN:
		return "OCCUPANCY_UNKNOWN"
	case OCCUPANCY_EMPTY:
		return "OCCUPANCY_EMPTY"
	case OCCUPANCY_MANY_AVAILABLE:
		return "OCCUPANCY_MANY_AVAILABLE"
	case OCCUPANCY_FEW_AVAILABLE:
		return "OCCUPANCY_FEW_AVAILABLE"
	case OCCUPANCY_STANDING_ONLY:
		return "OCCUPANCY_STANDING_ONLY"
	case OCCUPANCY_CRUSHED:
		return "OCCUPANCY_CRUSHED"
	case OCCUPANCY_FULL:
		return "OCCUPANCY_FULL"
	case OCCUPANCY_NOT_ACCEPTING:
		return "OCCUPANCY_NOT_ACCEPTING"
	}
	panic(errors.New("Invalid OccupancyStatus value"))
}

type WheelchairAccessibility uint

const (
	WHEELCHAIR_NO_DATA      WheelchairAccessibility = 0
	WHEELCHAIR_UNKNOWN      WheelchairAccessibility = 1
	WHHELCHAIR_ACCESSIBLE   WheelchairAccessibility = 2
	WHEELCHAIR_INACCESSIBLE WheelchairAccessibility = 3
)

func (t WheelchairAccessibility) String() string {
	switch t {
	case WHEELCHAIR_NO_DATA:
		return "WHEELCHAIR_NO_DATA"
	case WHEELCHAIR_UNKNOWN:
		return "WHEELCHAIR_UNKNOWN"
	case WHHELCHAIR_ACCESSIBLE:
		return "WHHELCHAIR_ACCESSIBLE"
	case WHEELCHAIR_INACCESSIBLE:
		return "WHEELCHAIR_INACCESSIBLE"
	}
	panic(errors.New("Invalid WheelchairAccessibility value"))
}

type DepartureStatus uint

const (
	IN_TRANSIT DepartureStatus = 0
	AT_STOP    DepartureStatus = 1
	INCOMING   DepartureStatus = 2
)

func (t DepartureStatus) String() string {
	switch t {
	case IN_TRANSIT:
		return "IN_TRANSIT"
	case AT_STOP:
		return "AT_STOP"
	case INCOMING:
		return "INCOMING"
	}
	panic(errors.New("Invalid DepartureStatus value"))
}
